<h1>Layouts</h1>

<p>
	Layouts in this library are very similar to layouts in Ruby on Rails and other frameworks. The basic idea is that most of your pages will share the same
	header, footer, wrapping navigation, etc and only the actual body of the page will change. Using this logic you can avoid repeating yourself and having lots of similar HTML.
</p>

<p>
	All layouts exist in <dfn>addons/themes/xxx/views/layouts/</dfn> and the default layout file funnily enough will be <dfn>addons/themes/views/layouts/default.html</dfn>.
</p>

<h2>Example Layout</h2>

<p>Using the template Tag you can output the title, metadata and body to create the most basic layout possible:</p>

<pre>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;{pyro:template:title}&lt;/title&gt;
	{pyro:template:metadata}
&lt;/head&gt;
&lt;body&gt;
	&lt;h1&gt;{pyro:template:title}&lt;/h1&gt;
	{pyro:template:body}
&lt;/body&gt;

&lt;/html&gt;</pre>

<h2>Different Layouts</h2>

<p>PyroCMS will check for a layout file that has the same name as a module. So if you want the news module to have a sidebar with some widgets, or a totally
different design, then you can create <dfn>addons/themes/xxx/views/layouts/news.html</dfn>. It will automatically be recognized and displayed.</p>

<h2>Mobile Layouts</h2>

<p>
	Instead of <dfn>addons/themes/xxx/views/layouts/default.html</dfn> try <dfn>addons/themes/xxx/views/web/layouts/default.html</dfn> and <dfn>addons/themes/xxx/views/mobile/layouts/default.html</dfn>.
	Same for all your other layout files, they will load the mobile version if you browse to the page with anything CodeIgniter thinks is a mobile phone (not an iPad).
</p>